import type { loginType, userInfo } from '@/type/login'
import mockHttp from '@/utils/request'

// 封装测试mock的函数
export const TestMoak = () => {
  return mockHttp.get('/test')
}
// /**
//  * 获取用户的访问的动态路由信息
//  * @returns Promise
//  */
// export const reqUserMenu = () => {
//   return mockHttp.get<>('/menu')
// }
/**
 * 登录验证
 * @param username 用户姓名
 * @param password 用户密码
 * @returns promise
 */
export const reqUserLogin = (username: string, password: string) => {
  return mockHttp.post<any, loginType>('/login', { username, password })
}
/**
 * 获取用户信息,里面会携带路由信息
 */
export const reqGetUserInfo = () => {
  return mockHttp.get<any, userInfo>('/userInfo')
}
